package goldendawn.footballalarm.tools;

import goldendawn.core.Transfer;
import goldendawn.footballalarm.entity.Fixtures;
import goldendawn.footballalarm.entity.Teams;

import java.util.ArrayList;
import java.util.List;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import android.content.Context;

public class TransferHelper extends Transfer {
		public TransferHelper(Context context) {
			super(context);
		}
		
		public ArrayList<Teams> getAllTeams()
		{
				ArrayList<Teams> list=null;
				String reString=get("getAllTeams");
	        	Gson gson=new Gson();
	        	if (reString!=null) {
					list = gson.fromJson(reString,new TypeToken<List<Teams>>(){}.getType());
				}
				return list;
		}
		
		public ArrayList<Fixtures> getFixturesByTeam(int team_id) {
			ArrayList<Fixtures> list=null;
			String reString=get("getFixturesByTeam/"+team_id);
        	Gson gson=new Gson();
        	if (reString!=null) {
				list = gson.fromJson(reString,new TypeToken<List<Fixtures>>(){}.getType());
			}
			return list;
		}
}
